using System.Data.Entity.ModelConfiguration;
using CH.FourBoards.LagerWalti.Persistence.Entities;

namespace CH.FourBoards.LagerWalti.Persistence.Mapping
{
	internal class DataMigrationMap : EntityTypeConfiguration<DataMigration>
	{
		internal DataMigrationMap()
		{
			// Attributes
			HasKey(t => t.Id);
			Property(t => t.Assembly).IsRequired();
			Property(t => t.Version).IsRequired();

			// Table & Column Mappings
			ToTable("__data_migration");
			Property(t => t.Id).HasColumnName("id");
			Property(t => t.Assembly).HasColumnName("assembly");
			Property(t => t.Version).HasColumnName("version");
		}
	}
}